﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SupportLayer.Objetos.Outros
{
  public class CorClass
  {
    public int ID { get; private set; }
    public string CorFundo { get; private set; }
    public string CorLetra { get; private set; }
    public string Descricao { get; private set; }

    public List<CorClass> GetAll()
    {
      return new List<CorClass>() 
      {
        new CorClass(){ ID = 1, CorFundo = "#008700", CorLetra = "#FFFFFF", Descricao = "Verde / Branco" },
        new CorClass(){ ID = 2, CorFundo = "#0000B4", CorLetra = "#FFFFFF", Descricao = "Azul / Branco" },
        new CorClass(){ ID = 3, CorFundo = "#5E3426", CorLetra = "#FFFFFF", Descricao = "Marrom / Branco" },
        new CorClass(){ ID = 4, CorFundo = "#EEEEEE", CorLetra = "#000000", Descricao = "Branco / Preto" },
        new CorClass(){ ID = 5, CorFundo = "#FF7F00", CorLetra = "#000000", Descricao = "Laranja / Preto" },
        new CorClass(){ ID = 6, CorFundo = "#FFFF00", CorLetra = "#000000", Descricao = "Amarelo / Preto" },
        new CorClass(){ ID = 7, CorFundo = "#FF7F00", CorLetra = "#FFFFFF", Descricao = "Laranja / Branco" },
        new CorClass(){ ID = 8, CorFundo = "#EEEEEE", CorLetra = "#FF0000", Descricao = "Branco / Vermelho" }
      };
    }

    public CorClass FindByID(int ID)
    {
      foreach (CorClass Cor in GetAll())
        if (Cor.ID == ID)
          return Cor;

      return null;
    }

    public CorClass FindByCorFundo(string CorFundo)
    {
      foreach (CorClass Cor in GetAll())
        if (Cor.CorFundo == CorFundo)
          return Cor;

      return null;
    }
    public CorClass FindByCorLetra(string CorLetra)
    {
      foreach (CorClass Cor in GetAll())
        if (Cor.CorLetra == CorLetra)
          return Cor;

      return null;
    }

  }
}
